#!/bin/bash # This bash script was created by M. Vyas and last modified by D. Friedlander # Last Modified: 1/22/15 # RMode is the run modeof the post-processing script # 0: Dynamically compute during Wind-US simulation # 1: Statically compute after Wind-US simulation RMode=0 # CMode is the computation mode of the post-processing script # 0: Skin Friction and Residuals # 1: Skin Friction only # 2: Residuals only # 3: U-Velocity only CMode=0 # TMode is the turbulence model mode of the post-processing script # 0: Spalart-Allmares # 1: SST TMode=1 # DO NOT NEED TO MODIFY CODE BELOW THIS POINT # if [ $CMode == 0 ]; then a=1 b=1 c=0 d=1 fi if [ $CMode == 1 ]; then a=1 b=1 c=0 d=0 fi if [ $CMode == 2 ]; then a=1 b=0 c=0 d=1 fi if [ $CMode == 3 ]; then a=1 b=0 c=1 d=0 fi if [ $RMode == 0 ]; then grid=FOR011 sol=FOR020 fi if [ $RMode == 1 ]; then grid=run.cgd sol=run.cfl fi ############### # Skin Friction ############### if [ $a == $b ]; then echo " clear all grid $grid sol $sol units si zone 1 surface u 4 cut at z 0 variable x mm variable Cfx genplot output xCf exit " > xCf.jou cfpost_prod.exe < xCf.jou #Creating .dat files in1=xCf.gen out1=xCf$1.dat sed -e '1,7d 457,682d' $in1 > $out1 rm -f xCf.jou mv xCf* results rm cfpost.jou fi ########### # Velocity ########### if [ $a == $c ]; then echo " clear all grid $grid solution $sol units si zone 1 surface u 1 surface u 2 cut at x 0.376 variable y mm variable u m sec genplot output yu376 clear all grid $grid solution $sol units si zone 1 surface u 1 surface u 2 cut at x 0.396 variable y mm variable u m sec genplot output yu396 clear all grid $grid solution $sol units si zone 1 surface u 1 surface u 2 cut at x 0.426 variable y mm variable u m sec genplot output yu426 clear all grid $grid solution $sol units si zone 1 surface u 1 surface u 2 cut at x 0.449 variable y mm variable u m sec genplot output yu449 exit " > velocity.jou cfpost_prod.exe < velocity.jou grep -v -e 'Exported' -e 'Strong' -e 'y' -e 'u' -e '^ *[0-9]* *$' yu376.gen > i376.dat grep -v -e 'Exported' -e 'Strong' -e 'y' -e 'u' -e '^ *[0-9]* *$' yu396.gen > i396.dat grep -v -e 'Exported' -e 'Strong' -e 'y' -e 'u' -e '^ *[0-9]* *$' yu426.gen > i426.dat grep -v -e 'Exported' -e 'Strong' -e 'y' -e 'u' -e '^ *[0-9]* *$' yu449.gen > i449.dat mv *.gen i3* i4* results/ rm velocity.jou fi ########### # Residuals ########### #Extract max residuals of N-S equations for all zones if [ $a == $d ]; then for ((nzone=1; nzone<=1; nzone++)) do grep -a RES run.lis | awk '{ print $2 " " $4 " " $8 }' | grep " $nzone " | awk '{ print $3 }' > nsl2$nzone.dat if [ $TMode == 0 ]; then grep -a *S-A run.lis | awk '{ print $2 " " $4 " " $8 }' | grep " $nzone " | awk '{ print $3 }' > sal2$nzone.dat fi if [ $TMode == 1 ]; then grep -a *SST run.lis | awk '{ print $2 " " $4 " " $8 }' | grep " $nzone " | awk '{ print $3 }' > sstl2$nzone.dat fi grep -a RES run.lis | awk '{ print $2 " " $4 " " $9 }' | grep " $nzone " | awk '{ print $3 }' > cfl$nzone.dat done mv nsl2* cfl* results/ if [ $TMode == 0 ]; then mv sal2* results/ fi if [ $TMode == 1 ]; then mv sstl2* results/ fi fi